<%=link_to 'Index',categories_path%>
<h1>Category</h1>
<%=form_for (@category),url: categories_path do |f|%>


<% if @category.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@category.errors.count, "error") %> prohibited this category from being saved:</h2>
      <ul>
      <% @category.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>
	<p><%=f.label "Name"%><%=f.text_field :name %></p>
	<%=f.submit "创建"%>
<% end %>